package RecursiveSearcher;

/**
 * @ClassName LC24
 * @Description 两两交换链表中的节点
 * @Author ZJX
 * @Date 2024/9/11 20:28
 * @Version 1.0
 */
public class LC24 {
    public ListNode swapPairs(ListNode head) {
        if (head == null || head.next == null){
            return head;
        }

        ListNode temp = swapPairs(head.next.next);

        ListNode ret = head.next;
        ret.next = head;
        head.next = temp;
        return ret;
    }
}
